# -*- coding: utf-8 -*-
class NewError(object):
    def __init__(self, code, message):
        self.result = {'code': code, 'message': message, 'data': {}}

    def data(self, data={}):
        if data is None:
            data = {}
        self.result['data'] = data
        return self.result


OK = NewError(0, "success")

ErrServerToken = NewError(1000, "Token exception")
ErrServerRuntime = NewError(1001, "Service running exception")

